<template>
  <div>
    <BoilerDetail />
  </div>
</template>

<script setup lang="ts">
import { userStore } from '@/stores/user'
import { getDetail } from '@/api/bsArchives/equipment'
import BoilerDetail from '@/views/bsArchives/equipment/boiler/BoilerDetail.vue'
const _userStore = userStore()
const dtInit = (equipcode: string, id: string) => {
  getDetail(equipcode, id).then((res) => {
    console.log(res)
  })
}
window.addEventListener(
  'message',
  (e) => {
    if (e.origin !== 'http://localhost:8081') return
    console.log(e.data)
    _userStore.token = e.data.token
    _userStore.sidToken = e.data.sidToken
    dtInit('1000', e.data.query.basicdatasysid)
    // 发送消息给domain1
    // window.parent.postMessage('来自domain2的消息', e.origin)
  },
  false
)
</script>
